package com.xxxx.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxxx.server.mapper.EmployeeTrainMapper;
import com.xxxx.server.pojo.EmployeeEcInfo;
import com.xxxx.server.pojo.EmployeeTrain;
import com.xxxx.server.pojo.EmployeeTrainBean;
import com.xxxx.server.pojo.RespPageBean;
import com.xxxx.server.service.IEmployeeTrainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhanglishen
 * @since 2020-11-14
 */
@Service
public class EmployeeTrainServiceImpl extends ServiceImpl<EmployeeTrainMapper, EmployeeTrain> implements IEmployeeTrainService {

    @Autowired
    private EmployeeTrainMapper employeeTrainMapper;

    @Override
    public RespPageBean getTrainList(Integer currentPage, Integer size, EmployeeTrainBean employeeTrainBean) {
        Page<EmployeeTrainBean> page = new Page<>(currentPage, size);
        IPage<EmployeeTrainBean> employeeIPage = employeeTrainMapper.getTrainList(page, employeeTrainBean);
        RespPageBean respPageBean = new RespPageBean(employeeIPage.getTotal(), employeeIPage.getRecords());
        return respPageBean;
    }
}
